//
//  TTPoint.h
//  iBeaconDemo
//
//  Created by CRY on 17/1/9.
//  Copyright © 2017年 eGova. All rights reserved.
//

#import <Foundation/Foundation.h>
@class TTLine;
@interface TTPoint : NSObject

@property (nonatomic, assign) double x;
@property (nonatomic, assign) double y;
@property (nonatomic, copy) NSString *floorName;

- (instancetype)initWithX:(double)x Y:(double)y;
- (instancetype)initWithX:(double)x Y:(double)y floorName:(NSString *)floorName;
- (double)distanceWithPoint:(TTPoint *)point;
+ (double)distanceWithPoint1:(TTPoint *)point1 piont2:(TTPoint *)point2;
/**
 * Addition of a point.
 *
 * @param piont the point to be added
 * @return a new point
 */
- (TTPoint *)add:(TTPoint *)piont;
/**
 * Negation of the point.
 *
 * @return the negated point
 */
- (TTPoint *)neg;
/**
 * Subtraction of a point.
 *
 * @param point the point to be subtracted
 * @return a new point
 */
- (TTPoint *)sub:(TTPoint *)point;
/**
 * Cross product (outer product).
 *
 * @param point the second point for the cross product
 * @return the result of the cross product
 */
- (double)cross:(TTPoint *)point;
/**
 *
 *
 * @param p1 the p1
 * @param p2 the p2
 * @return the double
 */
- (double)area2WithPiont1:(TTPoint *)p1 point2:(TTPoint *)p2;
/**
 * Checks if the point is located on the right side of the given line.
 *
 * @param l the line for the test
 * @return true, if the point is located on the right side, false otherwise
 */
- (BOOL)isRightOfLine:(TTLine *)l;

@end
